import request from '@/utils/request'

export const listtherapy = (search) => 
    request({
        url: '/therapy',
        method: 'get',
        params: {
            pageNum: search.pageNum,
            pageSize:search.pageSize,
            queryString:search.queryString
        }
    }) 

export const removetherapy = (id) => 
    request({
        url: '/therapy/' + id,
        method: 'delete'
    })

export const updatetherapy = (id, therapy) =>
    request({
        url: '/therapy/' + id,
        method: 'put',
        data: therapy
    })

export const savetherapy = (therapy) => 
    request({
        url: '/therapy',
        method: 'post',
        data: therapy
    })

    export const find = () =>
    request({
        url: '/therapy/',
        method: 'put'
    })
    export const findByid = (id) =>
    request({
        url: '/therapy/'+id,
        method: 'get'
    })
    export const finddietByid = (id) =>
    request({
        url: '/therapy/diet/'+id,
        method: 'get'
    })
    export const findexerciseByid = (id) =>
    request({
        url: '/therapy/exercise/'+id,
        method: 'get'
    })